home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 147 / Gekkan Dennou Club - 2000.8 Vol. 147 (Japan).7z / Gekkan Dennou Club - 2000.8 Vol. 147 (Japan) (Track 1).bin / fdimg / —‹Œêsrc.lzh / mouse.c < prev    next >
C/C++ Source or Header  |  1993-01-04  |  1KB  |  68 lines

  1. #include    "3DDEF.H"
  2. #include    "GLOBAL.H"
  3. #include    "FORWARD.H"
  4. #include    "XCODE.H"
  5. #include    "doslib.h"
  6.  
  7. /* 0x210 マウスでカーソル移動 */
  8. void
  9. mouse_cursor()
  10. {
  11.     register int x,y;
  12.     register int i,b;
  13.  
  14.     x = (y = MS_CURGT()) >> (16+3);    /* 横8ドットは変わらず */
  15.     y &= 0xffff;
  16.     i = 0;
  17.     while(y >= YDOT[i]) {
  18.         i++;
  19.     }
  20.     y = i-1;
  21.  
  22.     for(i = 0;i < MAX_WINDOW;i++) {
  23.         if (WDATA[i].WX0 >= 0) {    /* 有効である */
  24.             if ((WDATA[i].WY0 <= y) && (y <= (b = WDATA[i].WY1))) {    /* 入った */
  25.                 line_seigyou();
  26.                 if (CWN != i) {
  27.                     window_change(i);
  28.                 }
  29.                 if (SCREEN[y] && (SCREEN[y] != TAIL)) {
  30.                     CL = SCREEN[y];
  31.                     CY = window_is_this_line_in_current(CL);
  32. /*                    CY = y - CWY0;*/
  33.                     line_cl_cl();
  34.                     work_line_analyze();
  35.                     CPX = work_CX0_to_CPX(x);
  36.                     work_cursor_cpx();
  37.                     CX0 = CX;
  38.                 }
  39.                 return;
  40.             } else if (y == (b+1)) {    /* btm line */
  41.                 int cwn,y0,yd;
  42.  
  43.                 cwn = CWN;
  44.                 window_change(i);
  45.                 if ((y+1) == UNDER_Y) {    /* 一番下のボトムである */
  46.                     return;
  47.                 }
  48.                 y0 = YDOT[y];        /* btm のYドット座標 */
  49.                 while(MS_GETDT() & 0b00000000000000001111111100000000) {
  50.                     /* 左ボタンが押されている間 */
  51.                 }
  52.                 yd = (y = MS_CURGT() & 0xffff) - y0;
  53.                 if (yd < 0) {
  54.                     yd -= LYW_TOTAL;
  55.                 }
  56.                 if (y = yd / LYW_TOTAL) {
  57.                     ctrl_x_w_sub(CWY1-CWY0+1+y);
  58. /*                    ctrl_l();*/
  59. /*                    window_set_current();*/
  60.                     window_change(cwn);
  61.                 }
  62.                 return;
  63.             }
  64.         }
  65.     }
  66. }
  67.  
  68.